﻿<UserControl x:Class="EmployeeModule.EmployeeDetail.EmployeeDetailView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ldetail="clr-namespace:EmployeeModule.EmployeeDetail"
    xmlns:lchooser="clr-namespace:EmployeeModule.EmployeeChooser" 
    xmlns:prism="clr-namespace:Prism;assembly=Prism">
    <Border CornerRadius="4" BorderBrush="Black" BorderThickness="3" Padding="4" Margin="2">

        <UniformGrid HorizontalAlignment="Left" Columns="2" DataContext="{Binding DetailedEmployee}">
            <UniformGrid.Resources>
                <Style TargetType="TextBox">
                    <Setter Property="Margin" Value="2" />
                </Style>
                <Style TargetType="CheckBox">
                    <Setter Property="Margin" Value="2" />
                </Style>
            </UniformGrid.Resources>
            
            <Label>ID:</Label>
            <Label Content="{Binding PersonID}" />

            <Label>First name:</Label>
            <TextBox Text="{Binding Firstname}" />

            <Label>Last name:</Label>
            <TextBox Text="{Binding Lastname}" />

            <Label>WPF:</Label>
            <CheckBox IsChecked="{Binding WPF}" />

            <Label>WCF:</Label>
            <CheckBox IsChecked="{Binding WCF}" />

            <Label>WF:</Label>
            <CheckBox IsChecked="{Binding WF}" />

            <Label>EF:</Label>
            <CheckBox IsChecked="{Binding EF}" />

            <Label>Preferred development language:</Label>
            <TextBox Text="{Binding Language}" />


            <Label>Teamleader:</Label>
            <StackPanel Orientation="Horizontal">
                <ContentPresenter Content="{Binding TeamLeader}">
                    <ContentPresenter.ContentTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Label Content="Lastname:" />
                                <Label Content="{Binding Lastname}" />
                                <Label Content=", ID:"/>
                                <Label Content="{Binding PersonID}" />
                            </StackPanel>
                        </DataTemplate>
                    </ContentPresenter.ContentTemplate>
                </ContentPresenter>
                <Button Command="{x:Static lchooser:EmployeeChooserCommands.ChooseEmployee}">Choose</Button>
            </StackPanel>

            <Button Command="{x:Static ldetail:EmployeeDetailCommands.ReloadEmployee}">Reload</Button>
            <Button Command="{x:Static ldetail:EmployeeDetailCommands.SaveEmployee}">Save</Button>
            
        </UniformGrid>
    </Border>
</UserControl>
